package game.gui;

/**
 *
 * @author Gab'z
 */
import game.controler.ControleurJeu;
import game.controler.EtatJeu;
import java.awt.event.KeyAdapter;
import javax.swing.JFrame;

public class Frame extends JFrame {
    
    private static Frame frame = null;
    // private PanelJeu mainPanel;

    private Frame() {
        init();
    }
    
    public static Frame getFrame() {
        if (frame == null) {
            frame = new Frame();
        }
        return frame;
    }
    
    private void init() {
        this.setLayout(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Asylum");
        setSize(980, 750);
        setResizable(false);
        this.addKeyListener(new KeyAdapter() {
            
            @Override
            public void keyPressed(java.awt.event.KeyEvent evt) {
                if (EtatJeu.isPlaying()) {
                   ControleurJeu.afficheMenuAccueil(); 
                }
                
            }
        });
//
//        mainPanel = PanelJeu.getPanelJeu();
//        mainPanel.setLocation(0, 0);
//        mainPanel.setMenuAccueil();
//
//        mainPanel.setPanelVue("0");
//        this.add(mainPanel);

    }
}
